/**
 * @author: Jam
 * @create: 2018-03-26 17:05
 */
package com.byxy.service.impl;

import com.byxy.dao.AdminUserDao;
import com.byxy.model.AdminGroup;
import com.byxy.service.AdminUserTagService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.transaction.Transactional;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
@Transactional
public class AdminUserTagServiceImpl implements AdminUserTagService {
    @Autowired
    private AdminUserDao adminUserDao;

    @Override
    public Map<Integer, String> listGroup() {
        Map<Integer, String> map = new HashMap<>();
        map.put(null, "无");
        List<AdminGroup> adminGroupList = adminUserDao.listGroup();
        for (AdminGroup e : adminGroupList) {
            map.put(e.getId(), e.getTitle());
        }
        return map;
    }
}
